package com.study.casedemo;

import java.util.Scanner;

public class Demo5 {
    public static void main(String[] args) {
        // 评委打分案例：去掉最高分和最低分
        int[] arr = new int[6];
        Scanner sc = new Scanner(System.in);
        int max = 0;
        int min = 0;
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            System.out.println("第"+i+"个评委打分:");
            int nextInt = sc.nextInt();
            arr[i] = nextInt;
            if (max < nextInt){
                max = nextInt;
            }

            if (i>0 && min>nextInt || i==0){
                min = nextInt;
            }
            sum +=nextInt;
        }
        System.out.println("最大评分："+max);
        System.out.println("最小评分："+min);
        System.out.println("最后得分："+(sum-max-min)*1.0/(arr.length-2));
    }
}
